import request from '@/utils/request'

// 分页查询角色数据
export const GetSysUserListByPage = (pageNum , pageSize , queryDto) => {
    return request({
        url: '/admin/system/sysUser/findByPage' ,
        method: 'get',
        params: {
            ...queryDto,
            pageNum,
            pageSize
        }
    })
}

// 添加角色请求方法
export const SaveSysUser = (data) => {
    return request({
        url: '/admin/system/sysUser/saveSysUser',
        method: 'post',
        data
    })
}

// 保存修改
export const UpdateSysUser = (data) => {
    return request({
        url: '/admin/system/sysUser/updateSysUser',
        method: 'put',
        data
    })
}

// 删除角色
export const DeleteSysUserById = (userId) => {
    return request({
        url: '/admin/system/sysUser/deleteById/' + userId,
        method: 'delete'
    })
}

// 给用户分配角色请求
export const DoAssignRoleToUser = (assginRoleVo) => {
    return request({
        url: "/admin/system/sysUser/doAssign",
        method: 'post',
        data: assginRoleVo
    })
}